﻿#include "plan.h"


PlanType Plan::getType() const {
    return type;
}

void Plan::setType(PlanType newType) {
    type = newType;
}

const QString &Plan::getName() const {
    return name;
}

void Plan::setName(const QString &newName) {
    name = newName;
}

bool Plan::getFinish_if_week() const {
    return finish_if_week;
}

void Plan::setFinish_if_week(bool value) {
    finish_if_week = value;
}

Plan::Plan(QString name, PlanType type):name(name),type(type) {

}

void Plan::addEvent(Event event) {
    this->content[event.getName()] = event;
}

int Plan::contentCount() {
    return content.size();
}

Event Plan::getEventByName(QString name) {
    if(content.contains(name))return content[name];
}

QMap<QString, Event> &Plan::getEvents() {
    return this->content;
}
